game_manager
{
	spawn
	{
		accum 1 set 0		// State of objective number one
		accum 2 set 0		// Corrent number of controls destroyed
		accum 3 set 0		// Corrent number of Pak 75mm guns destroyed

		globalaccum 4 set 0
		globalaccum 3 set 0
		globalaccum 5 set 0

		// Game rules
		wm_axis_respawntime	20
		wm_allied_respawntime	15
		wm_number_of_objectives 8
		wm_set_round_timelimit	25

		// Objectives
		// 1: Primary1 : Destroy the North gun
		// 2: Primary2 : Destroy the South gun
		// 3: Primary3 : Blow up the controls
		// 4: Primary3 : Blow up the main entrance
		// 5: Secondary1 : Capture the Town
		// 6: Allied command post
		// 7: Axis command post

		// Current main objectives for each team (0=Axis, 1=Allies)
		wm_set_main_objective		8	0
		wm_set_main_objective		8	1

		// Objective overview status indicators
		//wm_objective_status <objective> <team (0=Axis, 1=Allies)> <status (0=neutral 1=complete 2=failed)>
		wm_objective_status 1 1 0
		wm_objective_status 1 0 0
		wm_objective_status 2 1 0
		wm_objective_status 2 0 0
		wm_objective_status 3 1 0
		wm_objective_status 3 0 0
		wm_objective_status 4 1 0
		wm_objective_status 4 0 0
		wm_objective_status 5 1 0
		wm_objective_status 5 0 0
		wm_objective_status 6 1 0
		wm_objective_status 6 0 0
		wm_objective_status 7 0 0
		wm_objective_status 7 1 0
		wm_objective_status 8 0 0
		wm_objective_status 8 1 0

		// Stopwatch mode defending team (0=Axis, 1=Allies)
		wm_set_defending_team	0

		// If the round timer expires, the Axis have won, so set the current winning team
		// Set the round winner:  0 == AXIS, 1 == ALLIED
		wm_setwinner 0

		// Set autospawn markers <team (0 = axis, 1 = allies)> <message key of marker>
		// Spawns on siwa:
		// Axis Garrison
		// Allied Camp
		// City
		wait 150

		setautospawn "Old City"			1
		setautospawn "Old City"			0

		wait 350

		disablespeaker allies_compost_sound		// allies command post
		disablespeaker axis_compost_sound		// axis command post

		wait 2000
		
		construct mg42_clip_1
		construct mg42_clip_2
	}

	trigger 75mm_gun_counter
	{
		accum 3 inc 1				// Increase game counter
		accum 3 abort_if_not_equal 3		// All guns destroyed ?

		wm_announce	"Allies have destroyed all Objectives!"

		wait 8000

		accum 1 set 3				// Both pak guns destroyed

		// Call function to check if the round has been won
		trigger game_manager checkgame
	}

	trigger checkgame
	{
		accum 3 abort_if_not_equal 3

		// Set the round winner:  0 == AXIS, 1 == ALLIED
		wm_setwinner 1

		// End the round
		wm_endround

		wait 500

		trigger end_tank Yippie
	}

	trigger timelimit_hit
	{
		trigger end_boom_north check_0
		trigger end_boom_south check_1
	}
}

oldcityflag
{
	spawn
	{
		accum 0 set 0	// Who has the flag: 0-Axis, 1-Allied
		remove
	}

	trigger axis_capture	// Flag has been touched by an Axis player
	{
		accum 0 abort_if_equal 0 // do Axis own flag?

		accum 0 set 0 // Axis own the pole
		wm_announce	"Axis reclaim the Garage!"

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "oasis_axis_city_defend"

		wm_addteamvoiceannounce 1 "oasis_allies_city_capture"

		wm_teamvoiceannounce 0 "oasis_axis_city_captured"

		wm_teamvoiceannounce 1 "oasis_allies_city_lost"

		wm_removeteamvoiceannounce 0 "oasis_axis_wall_defend"

		wm_removeteamvoiceannounce 1 "oasis_allies_wall_destroy"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 		5 0 1
		wm_objective_status 		5 1 2

		alertentity old_city_wobj
	}

	trigger allied_capture	// Flag has been touched by an allied player
	{
		accum 0 abort_if_equal 1 // do Allies own flag?

		accum 0 set 1 // Allied own the flag
		wm_announce	"Allies capture the garage!"

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "oasis_axis_wall_defend"

		wm_addteamvoiceannounce 1 "oasis_allies_wall_destroy"

		wm_teamvoiceannounce 0 "oasis_axis_city_lost"
		wm_teamvoiceannounce 0 "oasis_axis_wall_defend"

		wm_teamvoiceannounce 1 "oasis_allies_city_captured"
		wm_teamvoiceannounce 1 "oasis_allies_wall_destroy"

		wm_removeteamvoiceannounce 0 "oasis_axis_city_defend"

		wm_removeteamvoiceannounce 1 "oasis_allies_city_capture"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 		5 0 2
		wm_objective_status 		5 1 1

		alertentity old_city_wobj
	}

	trigger check_obj
	{
		accum 0 abort_if_equal 1 // Do Allied own the flag?

		wm_objective_status 		5 0 2
		wm_objective_status 		5 1 1

	}

	trigger force_allied
	{
		accum 0 abort_if_equal 1 // Do Allied own the flag?

		alertentity old_city_wobj
		alertentity oldcityspawns
	}

	trigger kill
	{
		remove
	}
}

oldcitywall //Broken section of Old City wall
{
	spawn
	{
		wait 200
		set
		{
		constructible_class 1
		health "100"
		}
	}

	death
	{
		trigger oldcityflag force_allied // Switch forward spawn to Allied ONLY

		trigger oldcityflag check_obj

		trigger oldcityflag kill

		wm_announce "Allies have gained acces to the Airfield"

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "airport_axis_plane_defend"

		wm_addteamvoiceannounce 1 "airport_allies_plane_destroy"

		wm_teamvoiceannounce 0 "oasis_axis_wall_destroyed"
		wm_teamvoiceannounce 0 "airport_axis_plane_defend"

		wm_teamvoiceannounce 1 "oasis_allies_wall_destroyed"
		wm_teamvoiceannounce 1 "airport_allies_plane_destroy"

		wm_removeteamvoiceannounce 0 "oasis_axis_wall_defend"
		wm_removeteamvoiceannounce 0 "oasis_axis_city_defend"

		wm_removeteamvoiceannounce 1 "oasis_allies_wall_destroy"
		wm_removeteamvoiceannounce 1 "oasis_allies_city_capture"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 		4 0 2
		wm_objective_status 		4 1 1

		wm_set_main_objective	1 0
		wm_set_main_objective	1 1
	}
}


// ================================================
// ========== CONSTRUCTIBLE STUFF =================
// ================================================

// Axis ONLY - Garrison MG Nest
mg42_clip_1
{
	spawn
	{
		wait 200

		constructible_class 2

		trigger mg42_clip_1 setup
	}

	trigger setup
	{
		setstate mg42_1 invisible

		setstate mg42_materials_1 default
		setstate mg42_materials_clip_1 default
		setstate mg42_flag_1 default
	}

	buildstart final
	{
		setstate mg42_1 underconstruction

		setstate mg42_materials_1 default
		setstate mg42_materials_clip_1 default
		setstate mg42_flag_1 default
	}

	built final
	{
		setstate mg42_1 default

		setstate mg42_materials_1 invisible
		setstate mg42_materials_clip_1 invisible
		setstate mg42_flag_1 invisible
	}

	death
	{
		setstate mg42_1 invisible
		repairmg42 mg42_1
		setstate mg42_materials_1 default
		setstate mg42_materials_clip_1 default
		setstate mg42_flag_1 default

		wm_announce	"The Airfield's MG Nest has been damaged!"
	}

	decayed final
	{
		setstate mg42_1 invisible

		setstate mg42_materials_1 default
		setstate mg42_materials_clip_1 default
		setstate mg42_flag_1 default
	}
}

// Allied ONLY - Old City MG Nest
mg42_clip_2
{
	spawn
	{
		wait 200

		constructible_class 2

		trigger mg42_clip_2 setup
	}

	trigger setup
	{
		setstate mg42_2 invisible

		setstate mg42_materials_2 default
		setstate mg42_materials_clip_2 default
		setstate mg42_flag_2 default
	}

	buildstart final
	{
		setstate mg42_2 underconstruction

		setstate mg42_materials_2 default
		setstate mg42_materials_clip_2 default
		setstate mg42_flag_2 default
	}

	built final
	{
		setstate mg42_2 default

		setstate mg42_materials_2 invisible
		setstate mg42_materials_clip_2 invisible
		setstate mg42_flag_2 invisible
	}

	death
	{
		setstate mg42_2 invisible
		repairmg42 mg42_2
		setstate mg42_materials_2 default
		setstate mg42_materials_clip_2 default
		setstate mg42_flag_2 default

		wm_announce	"The Casino's MG Nest has been damaged!"
	}

	decayed final
	{
		setstate mg42_2 invisible

		setstate mg42_materials_2 default
		setstate mg42_materials_clip_2 default
		setstate mg42_flag_2 default
	}
}

// ================================================
// ======== END CONSTRUCTIBLE STUFF ===============
// ================================================


// ================================================
// ========== DESTRUCTIBLE STUFF ==================
// ================================================

// North Gun
pak75_clip_1
{
	spawn
	{
		wait 200

		constructible_class 3

		trigger pak75_clip_1 setup
	}

	trigger setup
	{
		setstate pak75_smoke_1 invisible
		setstate pak75_model_broken_1 invisible
		setstate pak75_clip_broken_1 invisible

		setstate pak75_model_1 default
	}

	death
	{
		setstate pak75_smoke_1 default
		setstate pak75_model_broken_1 default
		setstate pak75_clip_broken_1 default

		setstate pak75_model_1 invisible

		togglespeaker pak75_expl_1

		wm_announce "Allies have destroyed the Cargoplane !"


		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "airport_axis_plane_defend"

		wm_addteamvoiceannounce 1 "airport_allies_plane_destroy"

		wm_teamvoiceannounce 0 "airport_axis_plane_destroyed"

		wm_teamvoiceannounce 1 "airport_allies_plane_destroyed"

		wm_removeteamvoiceannounce 0 "airport_axis_plane_defend"
		wm_removeteamvoiceannounce 0 "airport_axis_plane_defend"

		wm_removeteamvoiceannounce 1 "airport_allies_plane_destroy"
		wm_removeteamvoiceannounce 1 "airport_allies_plane_destroy"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 		1 0 2
		wm_objective_status 		1 1 1

		wm_set_main_objective	3 0
		wm_set_main_objective	3 1

		// Update game manager counter for objectives
		trigger game_manager 75mm_gun_counter

		trigger end_boom_north north_pak_destroyed
	}
}

// South Gun
pak75_clip_2
{
	spawn
	{
		wait 200

		constructible_class 3

		trigger pak75_clip_2 setup
	}

	trigger setup
	{
		setstate pak75_smoke_2 invisible
		setstate pak75_model_broken_2 invisible
		setstate pak75_clip_broken_2 invisible

		setstate pak75_model_2 default
	}

	death
	{
		setstate pak75_smoke_2 default
		setstate pak75_model_broken_2 default
		setstate pak75_clip_broken_2 default

		setstate pak75_model_2 invisible

		togglespeaker pak75_expl_2

		wm_announce "Allied team has destroyed the Cargoplane !"

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "airport_axis_plane_defend"

		wm_addteamvoiceannounce 1 "airport_allies_plane_destroy"

		wm_teamvoiceannounce 0 "airport_axis_plane_destroyed"

		wm_teamvoiceannounce 1 "airport_allies_plane_destroyed"

		wm_removeteamvoiceannounce 0 "airport_axis_plane_defend"
		wm_removeteamvoiceannounce 0 "airport_axis_plane_defend"

		wm_removeteamvoiceannounce 1 "airport_allies_plane_destroy"
		wm_removeteamvoiceannounce 1 "airport_allies_plane_destroy"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 		2 0 2
		wm_objective_status 		2 1 1

		wm_set_main_objective	3 0
		wm_set_main_objective	3 1

		// Update game manager counter for objectives
		trigger game_manager 75mm_gun_counter

		trigger end_boom_south south_pak_destroyed
	}
}
table
{
	spawn
	{
		wait 200
		constructible_class	3
                
	}

	death
	{
		wm_objective_status 		3 0 2
		wm_objective_status 		3 1 1

		wm_set_main_objective	3 0
		wm_set_main_objective	3 1

		wm_announce "Allies have destroyed the Axis Airfield Controls"

		// *----------------------------------- vo ------------------------------------------*
                
		wm_teamvoiceannounce 0 "battery_axis_generator_destroyed"

		wm_teamvoiceannounce 1 "battery_allies_generator_destroyed"

                // *---------------------------------------------------------------------------------*

		trigger game_manager 75mm_gun_counter

        }
}
// ================================================
// ======== END DESTRUCTIBLE STUFF ================
// ================================================

// ================================================
// =============== COMMAND POSTS ==================
// ================================================

allied_radio_destroyed
{
	spawn
	{
		wait 400
		setstate allied_radio_destroyed invisible
		setstate allied_radio_destroyed_model invisible
	}

	trigger hide
	{
		setstate allied_radio_destroyed invisible
		setstate allied_radio_destroyed_model invisible
	}

	trigger show
	{
		accum 0 abort_if_equal 0
		setstate allied_radio_destroyed default
		setstate allied_radio_destroyed_model default
	}

	trigger enable
	{
		accum 0 set 1
	}
}

allied_radio_closed
{
	trigger hide
	{
		setstate allied_radio_closed invisible
		setstate allied_radio_closed_model invisible
	}

	trigger show
	{
		accum 0 abort_if_equal 1
		setstate allied_radio_closed default
		setstate allied_radio_closed_model default
	}

	trigger disable
	{
		accum 0 set 1
	}
}

allied_radio_built
{
	spawn
	{
		wait 400

		constructible_class 2

		trigger allied_radio_built setup
	}

	trigger setup
	{
		setchargetimefactor 1 soldier 1
		setchargetimefactor 1 lieutenant 1
		setchargetimefactor 1 medic 1
		setchargetimefactor 1 engineer 1
		setchargetimefactor 1 covertops 1
		sethqstatus 1 0
	}

	buildstart final
	{
		trigger allied_radio_built_model trans

		trigger allied_radio_destroyed hide
		trigger allied_radio_closed 	hide
	}

	built final
	{
		trigger allied_radio_built_model show

		trigger allied_radio_destroyed enable
		trigger allied_radio_closed 	disable

		trigger allied_radio_built_model enable_allied_features

		enablespeaker allies_compost_sound
	}

	decayed final
	{
		trigger allied_radio_built_model hide

		trigger allied_radio_destroyed show
		trigger allied_radio_closed 	show
	}

	death
	{
		trigger allied_radio_built_model hide

		trigger allied_radio_destroyed show

		trigger allied_radio_built_model disable_allied_features

		disablespeaker allies_compost_sound
	}
}

allied_radio_built_model
{
	spawn
	{
		wait 400
		setstate allied_radio_built_model invisible
	}

	trigger show
	{
		setstate allied_radio_built_model default
	}

	trigger hide
	{
		setstate allied_radio_built_model invisible
	}

	trigger trans
	{
		setstate allied_radio_built_model underconstruction
	}

	trigger enable_allied_features
	{
		setchargetimefactor 1 soldier 0.75
		setchargetimefactor 1 lieutenant 0.75
		setchargetimefactor 1 medic 0.75
		setchargetimefactor 1 engineer 0.75
		setchargetimefactor 1 covertops 0.75
		sethqstatus 1 1

		wm_announce	"Allied Command Post constructed. Charge speed increased!"

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_compost_constructed_allies"

		wm_teamvoiceannounce 1 "allies_hq_compost_constructed"

		wm_removeteamvoiceannounce 1 "allies_hq_compost_construct"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 6 1 1
		wm_objective_status 6 0 2

	}

	trigger disable_allied_features
	{
		// Some kind of UI pop-up to alert players
		wm_announce	"Axis team has destroyed the Allied Command Post!"

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 1 "allies_hqt_compost_construc"

		wm_teamvoiceannounce 1 "allies_hq_compost_damaged"
		// *----------------------------------- vo ------------------------------------------*

		setchargetimefactor 1 soldier 1
		setchargetimefactor 1 lieutenant 1
		setchargetimefactor 1 medic 1
		setchargetimefactor 1 engineer 1
		setchargetimefactor 1 covertops 1
		sethqstatus 1 0

		wm_objective_status 6 1 0
		wm_objective_status 6 0 0
	}
}

axis_radio_destroyed
{
	spawn
	{
		wait 400
		setstate axis_radio_destroyed invisible
		setstate axis_radio_destroyed_model invisible
	}

	trigger hide
	{
		setstate axis_radio_destroyed invisible
		setstate axis_radio_destroyed_model invisible
	}

	trigger show
	{
		accum 0 abort_if_equal 0
		setstate axis_radio_destroyed default
		setstate axis_radio_destroyed_model default
	}

	trigger enable
	{
		accum 0 set 1
	}
}

axis_radio_closed
{
	trigger hide
	{
		setstate axis_radio_closed invisible
		setstate axis_radio_closed_model invisible
	}

	trigger show
	{
		accum 0 abort_if_equal 1
		setstate axis_radio_closed default
		setstate axis_radio_closed_model default
	}

	trigger disable
	{
		accum 0 set 1
	}
}

axis_radio_built
{
	spawn
	{
		wait 400

		constructible_class 2

		trigger axis_radio_built setup
	}

	trigger setup
	{
		setchargetimefactor 0 soldier 1
		setchargetimefactor 0 lieutenant 1
		setchargetimefactor 0 medic 1
		setchargetimefactor 0 engineer 1
		setchargetimefactor 0 covertops 1
		sethqstatus 0 0
	}

	buildstart final
	{
		trigger axis_radio_built_model trans

		trigger axis_radio_destroyed hide
		trigger axis_radio_closed 	hide
	}

	built final
	{
		trigger axis_radio_built_model show

		trigger axis_radio_destroyed enable
		trigger axis_radio_closed 	disable

		trigger axis_radio_built_model enable_axis_features

		enablespeaker axis_compost_sound
	}

	decayed final
	{
		trigger axis_radio_built_model hide

		trigger axis_radio_destroyed show
		trigger axis_radio_closed 	show
	}

	death
	{
		trigger axis_radio_built_model hide

		trigger axis_radio_destroyed show

		trigger axis_radio_built_model disable_axis_features

		disablespeaker axis_compost_sound
	}
}

axis_radio_built_model
{
	spawn
	{
		wait 400
		setstate axis_radio_built_model invisible
	}

	trigger show
	{
		setstate axis_radio_built_model default
	}

	trigger hide
	{
		setstate axis_radio_built_model invisible
	}

	trigger trans
	{
		setstate axis_radio_built_model underconstruction
	}

	trigger enable_axis_features
	{
		setchargetimefactor 0 soldier 0.75
		setchargetimefactor 0 lieutenant 0.75
		setchargetimefactor 0 medic 0.75
		setchargetimefactor 0 engineer 0.75
		setchargetimefactor 0 covertops 0.75
		sethqstatus 0 1

		wm_announce	"Axis Command Post constructed. Charge speed increased!"

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_compost_constructed"

		wm_teamvoiceannounce 1 "allies_hq_compost_constructed_axis"

		wm_removeteamvoiceannounce 0 "axis_hq_compost_construct"
		// *----------------------------------- vo ------------------------------------------*

		wm_objective_status 7 1 2
		wm_objective_status 7 0 1

	}

	trigger disable_axis_features
	{
		// Some kind of UI pop-up to alert players
		wm_announce	"Allied team has destroyed the Axis Command Post!"

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"

		wm_teamvoiceannounce 0 "axis_hq_compost_damaged"
		// *----------------------------------- vo ------------------------------------------*

		setchargetimefactor 0 soldier 1
		setchargetimefactor 0 lieutenant 1
		setchargetimefactor 0 medic 1
		setchargetimefactor 0 engineer 1
		setchargetimefactor 0 covertops 1
		sethqstatus 0 0

		wm_objective_status 7 1 0
		wm_objective_status 7 0 0
	}
}


axis_command_post_lms_toi
{
	spawn
	{
		wait 400

		remove
	}
}

axis_radio_lms_closed
{
	spawn
	{
		wait 400

		remove
	}
}

axis_radio_lms_destroyed
{
	spawn
	{
		wait 400

		remove
	}
}

axis_radio_built_lms
{
	spawn
	{
		wait 400

		remove
	}
}

axis_radio_closed_lms_model
{
	spawn
	{
		wait 400

		remove
	}
}

axis_radio_destroyed_lms_model
{
	spawn
	{
		wait 400

		remove
	}
}

axis_radio_built_lms_model
{
	spawn
	{
		wait 400

		remove
	}
}

axis_command_post_clip_lms
{
	spawn
	{
		wait 400

		remove
	}
}
// ===================================================
// ============== END COMMAND POSTS ==================
// ===================================================


// ======================================================
// ==============  END SEQUENCE Start  ==================
// ======================================================

end_tank
{
	spawn
	{
		wait 50

		trigger self setinvisible
	}

	trigger setinvisible
	{
		setstate end_tank invisible
	}

	trigger Yippie
	{
		setstate end_tank default

		setspeed -700 0 0
		wait 2000
		setspeed -100 0 0

		trigger end_tank sound_move

		wait 8200

		setspeed -40 0 0

		trigger end_tank sound_stop

		faceangles 2 180 0 300
		setspeed 0 0 0
		faceangles 0 180 0 650
	}

	trigger sound_move
	{
		stopsound
		playsound sound/vehicles/tank/tank_move.wav looping volume 512
	}

	trigger sound_stop
	{
		stopsound
		playsound sound/vehicles/tank/tank_revdown.wav volume 196
	}

}

end_boom_north
{
	spawn
	{
		wait 400

		accum 0 set 0
	}

	trigger check_0
	{
		accum 0 abort_if_greater_than 3

		wait 100

		trigger self Yippie_north

	}

	trigger north_pak_destroyed
	{
		accum 0 set 3
	}

	trigger Yippie_north
	{
		wait 200

		trigger pak75_model_1 aim

		wait 1800

		alertentity end_boom_north

		trigger end_north_pak_muzzle Yippie

		trigger pak75_model_1 Yippie

		wait 400

		trigger self sound_explosion
	}

	trigger sound_explosion
	{
		togglespeaker end_explosion_north
	}
}

end_boom_south
{
	spawn
	{
		wait 400

		accum 1 set 0
	}

	trigger check_1
	{
		accum 1 abort_if_greater_than 3

		wait 100

		trigger self Yippie_south

	}

	trigger south_pak_destroyed
	{
		accum 1 set 3
	}

	trigger Yippie_south
	{
		wait 400

		trigger pak75_model_2 aim

		wait 3800

		alertentity end_boom_south

		trigger end_south_pak_muzzle Yippie

		trigger pak75_model_2 Yippie

		wait 300

		trigger self sound_explosion
	}

	trigger sound_explosion
	{
			togglespeaker end_explosion_south
	}
}

end_north_pak_muzzle
{
	spawn
	{
		wait 150

		setstate end_north_pak_muzzle invisible
	}

	trigger Yippie
	{
		setstate end_north_pak_muzzle default
		trigger self sound_shot
		wait 100
		setstate end_north_pak_muzzle invisible
	}

	trigger sound_shot
	{
		togglespeaker north_pak_fire
	}
}

end_south_pak_muzzle
{
	spawn
	{
		wait 150

		setstate end_south_pak_muzzle invisible
	}

	trigger Yippie
	{
		setstate end_south_pak_muzzle default
		trigger self sound_shot
		wait 100
		setstate end_south_pak_muzzle invisible
	}

	trigger sound_shot
	{
		togglespeaker south_pak_fire
	}
}

pak75_model_1
{
	trigger aim
	{
		faceangles 0 286 0 1400
	}

	trigger Yippie
	{
		setspeed -100 0 0
		wait 150
		setspeed 30 0 0
		wait 500
		setspeed 0 0 0
	}
}

pak75_model_2
{
	trigger aim
	{
		faceangles 0 276 0 3200
	}

	trigger Yippie
	{
		setspeed -100 0 0
		wait 150
		setspeed 30 0 0
		wait 500
		setspeed 0 0 0
	}
}

tb
{
	spawn
	{
		wait 200
		trigger tb setup
		constructible_class 2
	}

	trigger setup
	{
		setstate tb invisible
		setstate tb_materials default
		setstate tb_materials_clip default
		setstate tb_flag default
	}

	buildstart final
	{
		setstate tb underconstruction
		setstate tb_materials default
		setstate tb_materials_clip default
		setstate tb_flag default

	}

	built final
	{
		setstate tb default
		setstate tb_materials invisible
		setstate tb_materials_clip invisible
		setstate tb_flag invisible

		wm_announce	"the side door has been contructed"
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "swoasis_axis_entrance2_rebuilt"
		wm_teamvoiceannounce 1 "oasis_allies_entrance2_destroy"

		wm_removeteamvoiceannounce 0 "swoasis_axis_entrance2_rebuild"
		wm_removeteamvoiceannounce 1 "oasis_allies_entrance2_destroy"
		// *---------------------------------------------------------------------------------*
	}

	decayed final
	{
		setstate tb invisible
		setstate tb_materials default
		setstate tb_materials_clip default
		setstate tb_flag default
	}

	death
	{
		setstate tb invisible
		setstate tb_materials default
		setstate tb_materials_clip default
		setstate tb_flag default


		wm_announce	"the side door has been destroyed"
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "oasis_axis_entrance2_destroyed"
		wm_teamvoiceannounce 1 "oasis_allies_entrance2_destroyed"

		wm_removeteamvoiceannounce 0 "oasis_axis_entrance2_destroyed"
		wm_removeteamvoiceannounce 1 "oasis_allies_entrance2_destroyed"
		// *---------------------------------------------------------------------------------*
	}
}

// ======================================================
// ==============   END SEQUENCE End   ==================
// ======================================================


radar1
{
	spawn
	{
		wait 50
		trigger self draaien
	}
	trigger draaien
	{
		stoprotation
		halt
		accum 0 random 100
		wait random 4000 10000
		trigger self linksom
		trigger self rechtsom
	}
	trigger linksom
	{
		accum 0 abort_if_less_than 50
		setrotation 0 10 0
		wait random 6000 15000
		trigger self draaien
	}
	trigger rechtsom
	{
		accum 0 abort_if_greater_than 50
		setrotation 0 -10 0
		wait random 6000 15000
		trigger self draaien
	}
}
radar2
{
	spawn
	{
		wait 50
		trigger self draaien
	}
	trigger draaien
	{
		stoprotation
		halt
		accum 0 random 100
		wait random 4000 10000
		trigger self linksom
		trigger self rechtsom
	}
	trigger linksom
	{
		accum 0 abort_if_less_than 50
		setrotation 0 10 0
		wait random 6000 15000
		trigger self draaien
	}
	trigger rechtsom
	{
		accum 0 abort_if_greater_than 50
		setrotation 0 -10 0
		wait random 6000 15000
		trigger self draaien
	}
}
